package com.spzx.order.controller;

import com.spzx.common.core.web.domain.AjaxResult;
import com.spzx.order.domain.SubmitVo;
import com.spzx.order.domain.TradeVo;
import com.spzx.order.service.OrderInfoService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.aspectj.weaver.loadtime.Aj;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import static com.spzx.common.core.web.domain.AjaxResult.success;

@Tag(name = "订单接口")
@RequestMapping("orderInfo")
@RestController
public class OrderController {
    @Autowired
    OrderInfoService orderInfoService;
    //订单结算
    @Operation(summary = "订单结算")
    @GetMapping("trade")
    public AjaxResult orderTradeData() {
        TradeVo tradeVo = orderInfoService.getOrderTradeData();
        return AjaxResult.success(tradeVo);
    }
    @Operation(summary = "订单提交")
    @PostMapping("submitOrder")
    public AjaxResult orderSubmit(@RequestBody SubmitVo submitVo) {
        orderInfoService.submitOrder(submitVo);
        return AjaxResult.success();
    }

}
